<!DOCTYPE html>
<html>
 <head>
  <meta charset="UTF-8">
  <title>Restyaboard | API</title>
  <link rel="icon" type="image/png" href="images/favicon-32x32.png" sizes="32x32" />
  <link rel="icon" type="image/png" href="images/favicon-16x16.png" sizes="16x16" />
  <link href="css/typography.css" media="screen" rel="stylesheet" type="text/css" />
  <link href="css/reset.css" media="screen" rel="stylesheet" type="text/css" />
  <link href="css/screen.css" media="screen" rel="stylesheet" type="text/css" />
  <link href="css/reset.css" media="print" rel="stylesheet" type="text/css" />
  <link href="css/print.css" media="print" rel="stylesheet" type="text/css" />
  <script src="lib/jquery-1.8.0.min.js" type="text/javascript"></script>
  <script src="lib/jquery.slideto.min.js" type="text/javascript"></script>
  <script src="lib/jquery.wiggle.min.js" type="text/javascript"></script>
  <script src="lib/jquery.ba-bbq.min.js" type="text/javascript"></script>
  <script src="lib/handlebars-2.0.0.js" type="text/javascript"></script>
  <script src="lib/underscore-min.js" type="text/javascript"></script>
  <script src="lib/backbone-min.js" type="text/javascript"></script>
  <script src="swagger-ui.js" type="text/javascript"></script>
  <script src="lib/highlight.7.3.pack.js" type="text/javascript"></script>
  <script src="lib/jsoneditor.min.js" type="text/javascript"></script>
  <script src="lib/marked.js" type="text/javascript"></script>
  <script src="lib/swagger-oauth.js" type="text/javascript"></script>
  <script type="text/javascript">
	$(function() {
		var url = window.location.search.match(/url=([^&]+)/);
		if (url && url.length > 1) {
			url = decodeURIComponent(url[1]);
		} else {
			url = "/api_explorer/swagger.json";
		}
		window.swaggerUi = new SwaggerUi({
			url: url,
			dom_id: "swagger-ui-container",
			supportedSubmitMethods: ['get', 'post', 'put', 'delete', 'patch'],
			onComplete: function(swaggerApi, swaggerUi) {
				window.swaggerUi.api.setBasePath('/api');
				window.swaggerUi.api.schemes = location.protocol.replace(':', '');
				$('pre code').each(function(i, e) {
					hljs.highlightBlock(e)
				});
				addApiKeyAuthorization();
			},
			onFailure: function(data) {
				log("Unable to Load SwaggerUI");
			},
			docExpansion: "none",
			jsonEditor: false,
			apisSorter: "alpha",
			defaultModelRendering: 'schema',
			showRequestHeaders: false
		});
		var keyStr = 'ABCDEFGHIJKLMNOP' + 'QRSTUVWXYZabcdef' + 'ghijklmnopqrstuv' + 'wxyz0123456789+/' + '=';
		function encode(input) {
			var output = "";
			var chr1,
				chr2,
				chr3 = "";
			var enc1,
				enc2,
				enc3,
				enc4 = "";
			var i = 0;
			do {
				chr1 = input.charCodeAt(i++);
				chr2 = input.charCodeAt(i++);
				chr3 = input.charCodeAt(i++);
				enc1 = chr1 >> 2;
				enc2 = ((chr1 & 3) << 4) | (chr2 >> 4);
				enc3 = ((chr2 & 15) << 2) | (chr3 >> 6);
				enc4 = chr3 & 63;
				if (isNaN(chr2)) {
					enc3 = enc4 = 64;
				} else if (isNaN(chr3)) {
					enc4 = 64;
				}
				output = output + keyStr.charAt(enc1) + keyStr.charAt(enc2) + keyStr.charAt(enc3) + keyStr.charAt(enc4);
				chr1 = chr2 = chr3 = "";
				enc1 = enc2 = enc3 = enc4 = "";
			}
			while (i < input.length);
			return output;
		}
		function addApiKeyAuthorization() {
			var key = $('#input_apiKey')[0].value;
			if (key && key.trim() != "") {
				key = "Basic " + encode(key);
				window.swaggerUi.api.clientAuthorizations.add("key", new SwaggerClient.ApiKeyAuthorization("Authorization", key, "header"));
			}
		}
		$('#input_apiKey').change(addApiKeyAuthorization);
		window.swaggerUi.load();
		window.swaggerUi.api.setHost(location.host);
		function log() {
			if ('console' in window) {
				console.log.apply(console, arguments);
			}
		}
	});
  </script>
 </head>
 <body class="swagger-section">
  <div id='header'>
   <div class="swagger-ui-wrap">
    <a id="logo" href="/">Restyaboard</a>
    <form id='api_selector'>
     <div class='input'>
      <input placeholder="ClientId:ClientSecret" id="input_apiKey" name="apiKey" type="text" value="" />
     </div>
    </form>
   </div>
  </div>
  <div id="message-bar" class="swagger-ui-wrap" data-sw-translate>&nbsp;</div>
  <div data-sw-translate class="token-link">&nbsp;To generate guest access token, please click <a href="#!/users/get_v1_oauth_json" onClick="window.location.reload();">here </a>.</div>
  <div id="swagger-ui-container" class="swagger-ui-wrap"></div>
 </body>
</html>